<?php $__env->startSection('title'); ?><?php echo Lang::get('misc.goods_for_sale'); ?> -<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?> 
     
     <?php 
     
	 $page = Input::get('page');
	 
     // ** Admin Settings ** //
     $settings = AdminSettings::first();

		 $sql   = Shots::where('url_purchased','!=','')
		 ->where('status',1)
		 ->orderBy('id','DESC')
		 ->paginate( $settings->result_request ); //$settings->result_request

		 
	 //<<---- * Total Search * ------->
	 $totalSearch = $sql->getTotal();

     ?>
     	<!-- Col MD -->
<div class="col-md-8">	
	

<h1 class="title-item none-overflow">

	<?php echo Lang::get('misc.goods_for_sale'); ?>

	</h1>
<hr />
     
     <?php foreach( $sql as $shot ): ?>	
     
     <?php
	
	if( Str::slug( $shot->title ) == '' ) {
	
		$slugUrl  = '';
	} else {
		$slugUrl  = '-'.Str::slug( $shot->title );
	}
	
	$slugUrlShot = URL::to('/').'/shots/'.$shot->id.$slugUrl;
	 ?>
     
     	<div class="media media-designer">
    		<span class="pull-left">
    			<a class="image-thumb" title="<?php echo $shot->name; ?>" href="<?php echo $slugUrlShot; ?>">
    			<img width="150" class="media-object img-rounded img-thumbnail" src="<?php echo URL::asset('public/shots_img') .'/'.$shot->image; ?>" />
    			</a>
    		</span>
    		<div class="media-body media-jobs">
    			<div class="pull-left desc-goods">
    				<h4 class="media-heading">
    				<a class="link-user-profile" title="<?php echo $shot->title; ?>" href="<?php echo $slugUrlShot; ?>"><?php echo e(Str::limit($shot->title, 25,  '...' )); ?></a> 
 
    				
    			</h4>
    			 <!-- List group -->
    			 <ul class="list-group list-designer">
    			 		
    			<?php 
		   		$url =  parse_url($shot->url_purchased);
				$host = $url['host'];
		   		?>
    			 		<li>
    			 			<a href="<?php echo e($shot->url_purchased); ?>" target="_blank" class="links-ds">
    			 				<span class="icon-cart myicon-right color-strong"></span>  <?php echo Lang::get('misc.buy_at'); ?> <?php echo e(Str::title($host)); ?> <strong>$<?php echo $shot->price_item; ?></strong>
    			 			</a>
    			 		</li>
    			 		
    			 		<li>
    			 			<a href="<?php echo URL::to('@').$shot->user()->username; ?>" target="_blank" class="links-ds">
    			 				<img width="18" height="18" class="img-circle" src="<?php echo URL::asset('public/avatar') .'/'.$shot->user()->avatar; ?>" />  <?php echo e($shot->user()->name); ?> 
    			 			</a>
    			 		</li>
    			 </ul>
    			</div><!-- /End Pull Left -->

    		</div><!-- /End Media Body -->
    		
</div><!-- /End Media -->
    		
    		<?php endforeach; ?>
    		
    		<?php if( $sql->count() == 0 ): ?>
    	<div class="btn-block text-center">
	    	<i class="icon-cart ico-no-result"></i>
	    </div>
    		<h3 class="margin-top-none text-center no-result">
	    	- <?php echo Lang::get('misc.no_goods'); ?> -
	    	</h3>
	    	<?php endif; ?>
	    	
	    	
    		<?php if( $sql->getLastPage() > 1 && $page <= $sql->getLastPage() ): ?>
	    	
	    		
	    		<div class="btn-group paginator-style">
	        		<?php echo $sql->links(); ?> 
	        	</div>
	        	
    		
    		<?php endif; ?>
    		
 </div><!-- /COL MD -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('sidebar'); ?>
<div class="col-md-4">

<?php if( Auth::check() && Auth::user()->type_account == 2 || Auth::check() && Auth::user()->type_account == 3 ): ?>
<a class="btn btn-danger btn-lg btn-block shadow-inset col-thumb" href="<?php echo URL::to('upload'); ?>">
		<i class="glyphicon glyphicon-cloud-upload myicon-right"></i> <?php echo Lang::get('misc.upload'); ?>

		</a>
		<?php endif; ?>

		<?php echo $__env->make('includes.ads', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
          
          
          
</div><!-- /End col md-4 -->

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>